package org.wechat4j.api.material;

import org.wechat4j.config.ApiConfig;
import org.wechat4j.utils.Https;

/**
 * @author bjliuyong
 * @version 1.0
 * @created date 16-11-15
 */
public class MaterialService {

    private static String mediaUploadUrl = ApiConfig.baseUrl + "media/upload?type=image&access_token=";

    public static String updateP(String filePath , String accessToken) {
        String requestUrl = "https://api.weixin.qq.com/cgi-bin/material/add_material?type=image&access_token=" + accessToken ;
        return Https.uploadFile(requestUrl , filePath ,"media") ;
    }

    public static String upload(String filePath,String accessToken) {
        return Https.uploadFile(mediaUploadUrl + accessToken , filePath ,"file");
    }
}
